package ntd.util.frame.action.database;

import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.c.opt.ComOpt;
import com.ToolOpt;
import ntd.action.ActionAbs;
import ntd.action.bo.ActionInfo;
import ntd.action.bo.ActionOutBo;

public class ActionTableView extends ActionAbs {

    @Override
    public ActionInfo info() {
        return new ActionInfo("数据-查询-详情", "action-table-view", new ActionTableView());
    }

    @Override
    public ActionOutBo handle() {
        ComOpt<Object> comOpt = ToolOpt.get(actionInBo.getDataCode(), actionInBo.dsId());

        String id = actionInBo.getParamStr("id");

        if (StrUtil.isBlank(id)) {
            id = actionInBo.getParamStr("id");
        }

        return new ActionOutBo(comOpt.getById(id));
    }

}
